package com.shenzhenai.composebasic.components

import androidx.compose.foundation.layout.Column
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview

/**
 * @author huangzehui
 * @date 12/9/2025 下午9:50 周五
 * @description
 *
 * 进度条
 * https://www.bilibili.com/video/BV1fT4y1D7yZ?vd_source=e07cc8cc94eb22bd76722071b03cd199&spm_id_from=333.788.videopod.sections
 */

@Composable
fun ProgressIndicatorSample() {
    Column {
        // 圆形进度条
        CircularProgressIndicator(
            color = Color.Blue,
            progress = {
                //  设置了值，就不会自动循环了
                0.9f
            }
        )

        //  水平进度条
        LinearProgressIndicator(
//            progress = {
//                //  设置了值，就不会自动循环了
//                0.5f
//            }
            // 进度条颜色
            color = Color.Red,
            // 进度条背景色
            trackColor = Color.Blue
        )
    }


}

@Preview
@Composable
fun ProgressIndicatorSamplePreview() {
    ProgressIndicatorSample()
}